package com.weetop.cfw.base.presenter.imp

import com.weetop.cfw.base.presenter.SuccessfulPaymentPresenter
import com.weetop.cfw.base.view.BaseView
import com.weetop.cfw.base.view.SuccessfulPaymentView
import com.weetop.cfw.bean.AudioVideoDetailBean
import com.weetop.cfw.callback.RxJavaCallBack
import com.weetop.cfw.mine.activity.SuccessfulPaymentActivity
import com.weetop.cfw.utils.RetrofitUtils
import com.weetop.cfw.utils.RxJavaUtils

class SuccessfulPaymentPresenterImp(var successfulPaymentView: SuccessfulPaymentView? = null):SuccessfulPaymentPresenter {
    /**
     * 获取课程详情
     */
    override fun getCourseDetail(successfulPaymentActivity: SuccessfulPaymentActivity, inforId: Int) {
        RxJavaUtils.useInAppCompatActivityOnDestory(RetrofitUtils.getApi().getCloudCurriculumDetail(inforId),successfulPaymentActivity,object:RxJavaCallBack<AudioVideoDetailBean>(){

            override fun onSuccess(t: AudioVideoDetailBean?) {

            }

        })
    }

    /**
     * 绑定
     */
    override fun attachView(baseView: BaseView) {
        successfulPaymentView = baseView as? SuccessfulPaymentView
    }

    /**
     * 解绑
     */
    override fun detachView() {
       successfulPaymentView = null
    }
}